package com.woniu.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Gateway
 */
@RestControllerAdvice
public class GlobelException {

    @ExceptionHandler(NullPointerException.class)
    public Map<String, String> nullPointer(Exception e) {
        Map<String, String> expMsg = new HashMap<>(16);
        expMsg.put("status", "1");
        expMsg.put("msg", "404页面缺失");
        e.printStackTrace();
        return expMsg;
    }
}
